home *** CD-ROM | disk | FTP | other *** search
- WBStartup
-
- ; This is a program to demonstrate how you can use MPictureDissolveIn to
- ; show a picture in a previously empty display, or dissolve a new picture
- ; into an existing one (same palette!).
-
- ; Choose a normal ILBM picture up to 256 colours for the source, and then
- ; choose an ILBM `effect' picture the same size.
-
- MReservec2pWindows 1
- MReserveBitmaps 3
-
- MCPU Processor
- Mc2pCPUmode Processor
-
- #Width=320 ; Width of operation
- #Height=240 ; Height of operation
- #EffectColours=128 ; Number of colours to use in effect bitmap (0..This). More colours means slower dissolve.
-
- InitBank 0,Max(320,#Width)*#Height,$10002 ; Chipmem
- CludgeBitMap 0,Max(320,#Width),#Height,8,Bank(0)
- InitPalette 0,256
-
- MaxLen ASLfile$=256
- MaxLen ASLpath$=256
- ASLpath$="Work:Test/"
- FindScreen 0
- Pic$=ASLFileRequest$("Choose an ILBM picture",ASLpath$,ASLfile$)
- LoadIFF Pic$,0,0 ; Source
- If MBitmap(0,#Width,#Height)=0 Then End
- ResetTimer
- MPlanar16ToBitmap 0,Bank(0)
- NPrint Timer
- MBitmap 2,#Width,#Height
-
- ;Take out these three lines for a fade in from nothing
- MBlockScroll 0,0,#Width,#Height,0,0,0
- MBitmapYFlip 2
- MBitmapXFlip 2
-
- Cls 0
- Pic$=ASLFileRequest$("Choose an ILBM effect picture",ASLpath$,ASLfile$)
- LoadIFF Pic$,0 ; Effect
- If MBitmap(1,#Width,#Height)=0 Then End
- ResetTimer
- MPlanar16ToBitmap 1,Bank(0)
- NPrint Timer
- Cls 0
- Mc2pWindow 0,#Width,#Height,#Width,Processor,#Width,#Height
- MUseBitmap 0,2 ; Dest is 2
- Screen 0,0,0,Max(320,#Width),#Height,8,0,"",0,0,0
- ShowPalette 0
- Mc2p 0,NPeekL(MAddrBitmap(2)+8),Bank(0)
- VWait 25
- ResetTimer
- For c=0 To #EffectColours-1
- MPictureDissolveIn 1,c
- Mc2p 0,NPeekL(MAddrBitmap(2)+8),Bank(0)
- Next c
- t=Timer
- ScreenToBack_ NPeekL(Addr Screen(0))
- a.q=50.0/(t/#EffectColours)
- NPrint "Displayed at ",a," frames per second."
- NPrint "Press mouse..."
- MouseWait
- End
-
-